Learn R Programming

chronosphere (version 0.3.1)

[<-,RasterArray,ANY,ANY,logical-method: Replace layers of a RasterArray object

Description

Single bracket '[' refers to indices and names within the RasterArray. Use double brackets to replace layers based on their names (in the stack).

Usage

# S4 method for RasterArray,ANY,ANY,logical
[(x, i, j, ...) <- value

# S4 method for RasterArray,ANY,ANY,RasterLayer [(x, i, j, ...) <- value

Arguments

x

RasterArray object.

i

subscript of the first dimension(rows) or vector-like subsetting.

j

subscript of the second dimension (columns).

...

subscript of additional dimensions.

value

A RasterLayer or RasterArray object.

Value

None.

Examples

Run this code
# NOT RUN {
data(dems)
# replace third element with missing value
dems[3] <- NA
# duplicate first element and make it the second too
dems[2] <-dems[1]

# }

Run the code above in your browser using DataLab